#ifndef ID_HACKER_H
#define ID_HACKER_H
#include <QObject>
#include <QMap>

#include <QtQuick/QQuickPaintedItem>
//一些情况下某些对象没有提供外部接口或导出对象。通过该类可以将对应id的对象挖出来

class IdHacker:public QObject{
    Q_OBJECT
    QML_ELEMENT
    Q_DISABLE_COPY(IdHacker)
    Q_PROPERTY(QObject* target READ target WRITE setTarget NOTIFY targetChanged)
public:

    void setTarget(QObject* target);
    QObject* target();

    IdHacker();
    ~IdHacker();

    Q_INVOKABLE void update();

signals:
    void targetChanged();

private:
    QObject* m_target = nullptr;
};

#endif
